package com.kly.cashmall.popup;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;

import com.kly.cashmall.R;
import com.kly.cashmall.utils.data.TextUtil;

import razerdp.basepopup.BasePopupWindow;

/**
 * Created by
 * on 2019/5/9.
 */
public class ErrorMsgPopup extends BasePopupWindow {

    private TextView mContent;
    private TextView mKnow;
    private View mRestRange;

    public ErrorMsgPopup(Activity activity) {
        super(activity);
        setContentView(R.layout.popup_error_msg);
        initView();
    }

    private void initView() {
        mKnow = findViewById(R.id.tv_know);
        mContent = findViewById(R.id.tv_content);
        mRestRange = findViewById(R.id.rest_range);
        initEvent();
    }

    private void initEvent() {
        mKnow.setOnClickListener(view -> {
            dismiss();
        });
        mRestRange.setOnClickListener(view -> {
            dismiss();
        });
    }

    public void setContent(String content){
        if (!TextUtil.isEmpty(content)){
            mContent.setText(content);
        }
    }
}
